﻿using System;
using System.Globalization;
using System.Windows.Data;

namespace LS.DicomViewer.Converters
{
    public class BoolToDoubleConverter : IValueConverter
    {
        public double TrueValue { get; set; } = 60;

        public double FalseValue { get; set; } = 0;

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return value == null ? FalseValue : value.Equals(true) ? TrueValue : FalseValue;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return value == null ? FalseValue : value.Equals(TrueValue);
        }
    }
}
